package m.appserver;

import com.alibaba.fastjson.JSONObject;
import io.netty.handler.codec.http.HttpMethod;
import m.common.action.Action;

public class ActionRedirect {
    /**
     * uriMethod  uri方法
     * action action类
     * method 执行action方法
     */
    public ActionRedirect(HttpMethod uriMethod,Class<? extends Action> action,String method){
        this(uriMethod,action,method,null);
    }
    /** 默认GET
     * action action类
     * method 执行action方法
     */
    public ActionRedirect(Class<? extends Action> action,String method){
        this(HttpMethod.GET,action,method,null);
    }
    /** 默认POST
     * action action类
     * method 执行action方法
     * json 附加参数
     */
    public ActionRedirect(Class<? extends Action> action,String method,JSONObject json){
        this(HttpMethod.POST,action,method,json);
    }
    /**
     * uriMethod  uri方法
     * action action类
     * method 执行action方法
     * json 附加参数
     */
    public ActionRedirect(HttpMethod uriMethod,Class<? extends Action> action,String method,JSONObject json){
        this.uriMethod=uriMethod;
        this.action=action;
        this.method=method;
        this.json=json;
    }
    private HttpMethod uriMethod;
    private Class<? extends Action> action;
    private String method;
    private JSONObject json;

    public Class<? extends Action> getAction() {
        return action;
    }

    public void setAction(Class<? extends Action> action) {
        this.action = action;
    }

    public HttpMethod getUriMethod() {
        return uriMethod;
    }

    public void setUriMethod(HttpMethod uriMethod) {
        this.uriMethod = uriMethod;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public JSONObject getJson() {
        return json;
    }

    public void setJson(JSONObject json) {
        this.json = json;
    }
}
